$(function () {

    var classOrderChart_datagrid =  $('#classOrderChart_datagrid');
    var classOrderChart_dialog =  $('#classOrderChart_dialog');

    //数据表格
    classOrderChart_datagrid.datagrid({

        url:'/chartController/list.do',
        striped:true,
        singleSelect:true,
        pagination:true,
        //自适应表格
        fitColumns:true,
        rownumbers:true,
        toolbar:"#tb",
        columns:[[
            {field:'className',title:'分组信息',width:100},
            {field:'hasTotalAmount',title:'已付总款',width:100},
            {field:'noTotalAmount',title:'未付总款',width:100}
        ]]
    });
    //end


    var cmdObj = {
        //刷新
        reload :function () {
            classOrderChart_datagrid.datagrid("reload");
        },
        //柱状报表
        btn_bar : function () {
            classOrderChart_dialog.dialog({
                title: '统计报表',
                width: '50%',
                height: '70%',
                closed: false,
                cache: false,
                href: '/chartController/ChartByBar.do',
                modal: true
            });

        },
        //饼状报表
        btn_pie : function () {
            classOrderChart_dialog.dialog({
                title: '统计报表',
                width: '50%',
                height: '70%',
                closed: false,
                cache: false,
                href: '/chartController/ChartByPie.do',
                modal: true
            });
        }
    };
    //抽取优化
    $("a").click(function () {
        var cmd = $(this).data("cmd");

        cmdObj[cmd]();
    })

});//end

function quickCheck(a) {
    $("#classOrderChart_datagrid").datagrid("load",{
        typeId: a
    });

}












